<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Max(x,y){
        var max;//函数内定义的变量，作用域是当前函数
        max=x>y?x:y;
        return max;
    }
    //全局变量
    var max;
    max=Max(100,200);
    alert("Max(100,200)="+max);
</script>
</html>